<?php
namespace My\Model;

use Utuo\UtuoModel;

class MallJobTitleModel extends UtuoModel {

	/**
	 * 获得头衔列表
	 * @return unknown
	 */
	public static function getJobTitleList( $cid ) {
		$jobTitleList = M("MallJobTitle a")->join("__MALL_JOB_TITLE_ALIAS__ b on a.id = b.type and b.cid = {$cid}", "LEFT")
										->field("a.id,(case length(b.aliasName)>0 when 1 then b.aliasName else a.name end) as name")
										->select();
		$data = array();
		foreach ( $jobTitleList as $v ) {
			$data[$v['id']] = $v['name'];
		}
		return $data;
	}
	
}